<include file="./Tm/Dt/Top.html" />

<include file="./Tm/Dt/Left.html" />


<div id="right">
    <include file="./Tm/Dt/Nav.html" />
    <!--主要内容块-->
    <div class="main">
        <!--<div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <div class="tabbable" id="tabs-184023">
                        <div>
                            <ul class="nav nav-tabs">
                                <li class="active">
                                    <a href="#panel-32409" data-toggle="tab">修改登录密码</a>
                                </li>
                                <li>
                                    <a href="#panel-915331" data-toggle="tab">修改安全密码</a>
                                </li>
                            </ul>
                        </div>
                        <div class="wxts2">
                            <p><i class="glyphicon glyphicon-play"></i>&nbsp;温馨提示</p>
                            <p class="borcent"></p>
                            <h2>为了您的账户安全，请及时修改密码，尽量保持登录密码和安全密码的不同。</h2>
                        </div>
                        <div class="tab-content bgcolor-d5e2eb">
                            <div class="tab-pane active">
                                <div class="dlmm">
                                    <form class="form-horizontal" role="form">
                                        <div class="form-group">
                                            <label for="inputEmail3" class="col-sm-3 control-label">原登录密码</label>
                                            <div class="col-sm-9">
                                                <input type="password" class="form-control" id="password" name="password" placeholder="输入原登录密码">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="inputPassword3" class="col-sm-3 control-label">新登录密码</label>
                                            <div class="col-sm-9">
                                                <input type="password" class="form-control" id="newpassword" name="newpassword" placeholder="输入新登录密码">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="inputPassword3" class="col-sm-3 control-label">确认新登录密码</label>
                                            <div class="col-sm-9">
                                                <input type="password" class="form-control" id="renewpassword" name="renewpassword" placeholder="再次输入新登录密码">
                                            </div>
                                        </div>
                                        <div class="form-group but-box">
                                            <div class="col-sm-offset-3 col-sm-8">
                                                <input type="submit" class="width-100" name="button1" id="button1" value="提交" onclick="return Check();" />
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <div class="tab-pane active" id="panel-589644">
								<div class="tab-pane">
	                                <div class="dlmm">
	                                    <form class="form-horizontal" role="form">
	                                        <div class="form-group">
	                                            <label for="inputEmail3" class="col-sm-3 control-label">原安全密码</label>
	                                            <div class="col-sm-9">
	                                                <input type="password" class="form-control" id="password" name="password" placeholder="输入原登录密码">
	                                            </div>
	                                        </div>
	                                        <div class="form-group">
	                                            <label for="inputPassword3" class="col-sm-3 control-label">新安全密码</label>
	                                            <div class="col-sm-9">
	                                                <input type="password" class="form-control" id="newpassword" name="newpassword" placeholder="输入新登录密码">
	                                            </div>
	                                        </div>
	                                        <div class="form-group">
	                                            <label for="inputPassword3" class="col-sm-3 control-label">确认新安全密码</label>
	                                            <div class="col-sm-9">
	                                                <input type="password" class="form-control" id="renewpassword" name="renewpassword" placeholder="再次输入新登录密码">
	                                            </div>
	                                        </div>
	                                        <div class="form-group but-box">
	                                            <div class="col-sm-offset-3 col-sm-8">
	                                                <input type="submit" class="width-100" name="button1" id="button1" value="提交" onclick="return Check();" />
	                                            </div>
	                                        </div>
	                                    </form>
	                                </div>
	                            </div>
							</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>-->
        <div class="container-fluid">
			<div class="row-fluid">
				<div class="span12">
					<div class="tabbable" id="tabs-992947">
						<ul class="nav nav-tabs">
							<li>
								<a href="#panel-354063" data-toggle="tab">修改登录密码</a>
							</li>
							<li class="active">
								<a href="#panel-589644" data-toggle="tab">修改安全密码</a>
							</li>
						</ul>
						<div class="wxts2">
                            <p><i class="glyphicon glyphicon-play"></i>&nbsp;温馨提示</p>
                            <p class="borcent"></p>
                            <h2>为了您的账户安全，请及时修改密码，尽量保持登录密码和安全密码的不同。</h2>
                        </div>
						<div class="tab-content bgcolor-d5e2eb">
							<div class="tab-pane" id="panel-354063">
								<div class="tab-pane active">
                                <div class="dlmm">
                                    <form class="form-horizontal" role="form">
                                        <div class="form-group">
                                            <label for="inputEmail3" class="col-sm-3 control-label">原登录密码</label>
                                            <div class="col-sm-9">
												<input type="password" class="form-control" id="password" name="password" placeholder="输入原登录密码">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="inputPassword3" class="col-sm-3 control-label">新登录密码</label>
                                            <div class="col-sm-9">
                                                <input type="password" class="form-control" id="newpassword" name="newpassword" placeholder="输入新登录密码">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="inputPassword3" class="col-sm-3 control-label">确认新登录密码</label>
                                            <div class="col-sm-9">
                                                <input type="password" class="form-control" id="renewpassword" name="renewpassword" placeholder="再次输入新登录密码">
                                            </div>
                                        </div>
                                        <div class="form-group but-box">
                                            <div class="col-sm-offset-3 col-sm-8">
                                                <input type="submit" class="width-100" name="button1" id="button1" value="提交" onclick="return Check();" />
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
							</div>
							<div class="tab-pane active" id="panel-589644">
								<div class="dlmm">
	                                    <form class="form-horizontal" role="form">
	                                        <div class="form-group">
	                                            <label for="inputEmail3" class="col-sm-3 control-label">原安全密码</label>
	                                            <div class="col-sm-9">
	                                                <input type="password" class="form-control" id="paypassword" name="paypassword" placeholder="输入原安全密码">
	                                            </div>
	                                        </div>
	                                        <div class="form-group">
	                                            <label for="inputPassword3" class="col-sm-3 control-label">新安全密码</label>
	                                            <div class="col-sm-9">
	                                                <input type="password" class="form-control" id="newpaypassword" name="newpaypassword" placeholder="输入新安全密码">
	                                            </div>
	                                        </div>
	                                        <div class="form-group">
	                                            <label for="inputPassword3" class="col-sm-3 control-label">确认新安全密码</label>
	                                            <div class="col-sm-9">
	                                                <input type="password" class="form-control" id="renewpaypassword" name="renewpaypassword" placeholder="再次输入新安全密码">
	                                            </div>
	                                        </div>
	                                        <div class="form-group but-box">
	                                            <div class="col-sm-offset-3 col-sm-8">
	                                                <input type="submit" class="width-100" name="button2" id="button2" value="提交" onclick="return CheckPayPassword();" />
	                                            </div>
	                                        </div>
											<div class="form-group but-box">
												<div class="col-sm-offset-3 col-sm-8">
													<a href="javascript:void();" onclick="repassword()">找回安全密码</a>
												</div>
											</div>
	                                    </form>
	                                </div>
							</div>


							<div class="tab-pane" style="display:none;" id="repassword" >
								<div class="dlmm">
									<form class="form-horizontal" role="form">
										<div class="form-group">
											<label for="inputEmail3" class="col-sm-3 control-label">手机号码</label>
											<div class="col-sm-9">
												<input type="text" class="form-control" id="mobile" name="mobile" placeholder="输入手机号码">
											</div>
										</div>

										<div class="form-group">
											<label for="inputPassword3" class="col-sm-3 control-label">手机验证码</label>
											<div class="col-sm-9">


												<input type="text" class="form-control" name="mobile_code" id="mobile_code" placeholder="请输入验证码">
												<div style="position: absolute;right: 15px;top: 0;">
													<input id="zphone" name="zphone" type="button" value=" 获取手机验证码 " onClick="get_mobile_code();" class="btn btn-danger">
												</div>
											</div>
										</div>
										<div class="form-group but-box">
											<div class="col-sm-offset-3 col-sm-8">

												<input type="hidden" id="uname" name="uname" value="{$Think.session.username}">
												<input type="button" class="width-100" name="button2" id="button3" value="下一步" onclick="return Checkrepassword();" />
											</div>
										</div>

									</form>
								</div>
							</div>


							<div class="tab-pane" style="display:none;" id="resetting">
								<div class="dlmm">
									<form class="form-horizontal" role="form">
										<div class="form-group">
											<label for="inputPassword3" class="col-sm-3 control-label">新安全密码</label>
											<div class="col-sm-9">
												<input type="password" class="form-control" id="snewpaypassword" name="snewpaypassword" placeholder="输入新登录密码">
											</div>
										</div>
										<div class="form-group">
											<label for="inputPassword3" class="col-sm-3 control-label">确认新安全密码</label>
											<div class="col-sm-9">
												<input type="password" class="form-control" id="srenewpaypassword" name="srenewpaypassword" placeholder="再次输入新登录密码">
											</div>
										</div>
										<div class="form-group but-box">
											<div class="col-sm-offset-3 col-sm-8">


												<input type="button" class="width-100" name="button2" id="button4" value="提交" onclick="return editpwd();" />
											</div>
										</div>

									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
    </div>



</div>



<include file="./Tm/Dt/Foot.html" />
<script src="__PUBLIC__/Dt/Home/password.js" type="text/javascript" charset="utf-8"></script>
<script>
	//获取手机验证码
	function get_mobile_code(){

		if ($.trim($('#uname').val()) == '')
		{
			alert('请先输入会员帐号');
			$('#uname').focus();
			return false;

		}
		if ($.trim($('#mobile').val()) == '')
		{
			alert('请先输入手机号码');
			$('#mobile').focus();
			return false;

		}
		var reg = /^1[3-9][0-9]\d{4,8}$/;
		if(!reg.test($.trim($('#mobile').val())))
		{
			alert("手机号码格式不对！");
			$('#mobile').focus();
			return false;
		}




		$.post('/home/index/sms', {uname:$.trim($('#uname').val()),mobile:jQuery.trim($('#mobile').val()),send_code:'{$Think.session.send_code}','template':'396416'  }, function(msg) {
			//alert(jQuery.trim(unescape(msg)));
			if(msg==1)
			{
				alert('会员帐号不存在，请重新输入会员帐号！');
				$('#uname').focus();
				return;
			}
			if(msg==2)
			{
				alert('手机号码不能为空！');
				$('#mobile').focus();
				return;
			}
			if(msg==5)
			{
				alert('会员帐户没有绑定手机！');
				$('#mobile').focus();
				return;
			}
			if(msg==6)
			{
				alert('输入手机与会员绑定手机不一致！');
				$('#mobile').focus();
				return;
			}
			if(msg==3)
			{
				alert('请求超时，请刷新页面后重试！');
				return;
			}

			//alert(jQuery.trim(unescape(msg)));
			//return;

			if(msg==7){
				alert('同一手机号验证码短信发送超出5条！');
				$('#mobile').focus();
				return;
			}
			if(msg==4){
				alert('手机验证码已经发送，请注意查收！');
				RemainTime();
			}


		});
	};
	var iTime = 59;
	var Account;
	function RemainTime(){
		document.getElementById('zphone').disabled = true;
		var iSecond,sSecond="",sTime="";
		if (iTime >= 0){
			iSecond = parseInt(iTime%60);
			iMinute = parseInt(iTime/60)
			if (iSecond >= 0){
				if(iMinute>0){
					sSecond = iMinute + "分" + iSecond + "秒";
				}else{
					sSecond = iSecond + "秒";
				}
			}
			sTime=sSecond;
			if(iTime==0){
				clearTimeout(Account);
				sTime='获取手机验证码';
				iTime = 59;
				document.getElementById('zphone').disabled = false;
			}else{
				Account = setTimeout("RemainTime()",1000);
				iTime=iTime-1;
			}
		}else{
			sTime='没有倒计时';
		}
		document.getElementById('zphone').value = sTime;
	}

var repassword=function()
{
	$('#panel-589644').hide();
	$('#repassword').show();
}

var Checkrepassword=function()
{
	if ($.trim($('#mobile').val()) == '')
	{
		alert('请先输入手机号码');
		$('#mobile').focus();
		return false;

	}
	var reg = /^1[3-9][0-9]\d{4,8}$/;
	if(!reg.test($.trim($('#mobile').val())))
	{
		alert("手机号码格式不对！");
		$('#mobile').focus();
		return false;
	}

	if ($.trim($('#mobile_code').val()) == '')
	{
		alert('请先输入手机验证码！');
		$('#mobile_code').focus();
		return false;

	}


	$.ajax({
		type: "POST",
		url: "/home/index/dopaysms",
		data: {
			'uname': $.trim($('#uname').val()),
			'mobile': $.trim($('#mobile').val()),
			'mobile_code': $.trim($('#mobile_code').val()),
		},
		async: true,
		success: function (msg) {
			if(msg==1)
			{
				alert('会员帐号不存在，请重新输入会员帐号！');
				$('#uname').focus();
				return false;
			}
			if(msg==2)
			{
				alert('会员帐户没有绑定手机号码！');
				$('#mobile').focus();
				return false;
			}
			if(msg==3)
			{
				alert('输入手机与绑定号不符！');
				$('#mobile').focus();
				return false;
			}
			if(msg==4)
			{
				alert('输入验证码不正确！');
				$('#mobile_code').focus();
				return false;
			}
			$('#repassword').hide();
			$('#resetting').show();

		}
	});

}

	//修改密码
	var editpwd=function()
	{
		if ($.trim($('#snewpaypassword').val()) == '')
		{
			alert('请先输入新安全密码');
			$('#snewpaypassword').focus();
			return false;

		}
		if($.trim($('#snewpaypassword').val()).length<6)
		{
			alert("新安全密码不能小于6位数！");
			$('#snewpaypassword').focus();
			return false;
		}

		if ($.trim($('#srenewpaypassword').val()) == '')
		{
			alert('请先输入确认新安全密码');
			$('#srenewpaypassword').focus();
			return false;

		}
		if ($.trim($('#srenewpaypassword').val()) != $.trim($('#srenewpaypassword').val()))
		{
			alert('新安全密码与确认新安全密码不一致，请重新输入！');
			$('#srenewpaypassword').focus();
			return false;

		}


		$.ajax({
			type: "POST",
			url: "/home/index/resetpaypwd",
			data: {
				'uname': $.trim($('#uname').val()),
				'mobile': $.trim($('#mobile').val()),
				'mobile_code': $.trim($('#mobile_code').val()),
				'newpwd': $.trim($('#snewpaypassword').val()),
			},
			async: true,
			success: function (msg) {

				if(msg=='success')
				{
					alert('重置安全密码成功，请用新安全密码进行排单！');

					$('#resetting').hide();
					$('#panel-589644').show();

				}
			}
		})
	}

</script>